
import _state from './state'
import { INCREMENT, SUBSTRACT } from './const'

const reducer = (state=_state, action) => {
    let new_state = Object.assign({}, state)
    switch( action.type ){
        case INCREMENT: new_state.num++; break;
        case SUBSTRACT: break;
        default: break;
    }
    return new_state;
}

export default reducer